package com.yy.sso.authority.center.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yy.sso.authority.center.model.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 角色表
 *
 * @author yangyao
 * @email 742425545@qq.com
 * @date 2019-12-06 16:36:39
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    @Select("SELECT r.* FROM  tb_role r " +
            "LEFT JOIN tb_user_role ur ON ur.role_id = r.id " +
            "WHERE u.id=#{userId}")
    List<Role> listByUserId(Long userId);
}
